<script setup lang="ts">
import type { HotItem } from '@/types/home'
defineProps<{ list: HotItem[] }>()
</script>

<template>
  <!-- 推荐专区 -->
  <view class="panel hot">
    <view class="item" v-for="item in list" :key="item.id">
      <view class="title">
        <text class="title-text">{{ item.title }}</text>
        <text class="title-desc">{{ item.alt }}</text>
      </view>
      <navigator hover-class="none" :url="`/pages/hot/hot?type=${item.type}`" class="cards">
        <image
          v-for="src in item.pictures"
          :key="src"
          class="image"
          mode="aspectFit"
          :src="src"
        ></image>
      </navigator>
    </view>
  </view>
</template>

<style lang="scss">
/* 热门推荐 */
.hot {
  display: flex;
  flex-wrap: wrap;
  min-height: 508rpx;
  margin: 20rpx 20rpx 0;
  border-radius: 10rpx;
  background-color: #fff;
  .item {
    display: flex;
    flex-direction: column;
    width: 50%;
    height: 254rpx;
    border-right: 1rpx solid #eee;
    border-top: 1rpx solid #eee;
    .title {
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 32rpx;
      padding: 24rpx 24rpx 0;
      color: #262626;
      .title-desc {
        font-size: 24rpx;
        margin-left: 18rpx;
        color: #7f7f7f;
      }
    }
    .cards {
      flex: 1;
      display: flex;
      padding: 15rpx 20rpx;
      justify-content: space-between;
      align-items: center;
      .image {
        width: 150rpx;
        height: 150rpx;
      }
    }
  }
}
</style>
